import request from '@/axios'

enum Api {
  getMenuList = "/auth/queryUserMenu",
  saveMenu = "/menu/save",
  updateMenu = "/menu/update",
  removeMenu = "/menu/remove",
  getAllMenu = "/menu",
  getPermission = "/menu/findPermission",
  addPermission = "/menu/addPermission",
  updatePermission = "/menu/updatePermission",
}

export const updatePermissionApi = (per: any) => {
  return request.post(Api.updatePermission, per)
}

export const addPermission = (params: any) => {
  return request.post(Api.addPermission, params)
}

export const getPermissionApi = (params: any) => {
  return request.get(Api.getPermission, params)
}

export const getAllMenuApi = (params: any) => {
  return request.get(Api.getAllMenu, params)
}

export const getMenuListApi = (params: any) => {
  return request.get(Api.getMenuList, params)
}

export const saveMenuApi = (data: any) => {
  return request.post(Api.saveMenu, data)
}

export const updateMenuApi = (data: any) => {
  return request.post(Api.updateMenu, data)
}

export const removeMenuApi = (data: any) => {
  return request.get(Api.removeMenu, data)
}